#ifndef TOPWIDGET_H
#define TOPWIDGET_H

#include <QWidget>
#include <QFileDialog>
#include <QMessageBox>

#include "opencv2/opencv.hpp"

namespace Ui {
class TopWidget;
}

class TopWidget : public QWidget
{
    Q_OBJECT

public:
    explicit TopWidget(QWidget *parent = nullptr);
    ~TopWidget();

private slots:
    void on_btnResetCamera_clicked();

    void on_btnOrthoMode_toggled(bool checked);

    void on_btnCamerMoveMode_toggled(bool checked);

    void on_sliderOpacity_valueChanged(int value);

    void on_sliderBrightness_valueChanged(int value);

    void on_sliderThreshold_valueChanged(int value);

    void on_btnPseudoColor_toggled(bool checked);

    void on_btnLookatXY_clicked();

    void on_btnLookatXZ_clicked();

    void on_btnLookatYZ_clicked();

    void on_btnLoadAVI_clicked();

    void on_sliderGradient_valueChanged(int value);

private:
    Ui::TopWidget *ui;

    void setPseudoColor(bool pseudo);

    bool readAVI8UC1Data(QString &fileName,unsigned char **dataptr,
                     int &width,int &height,int &count);
};

#endif // TOPWIDGET_H
